<template>
  <div id="unbatchInspection_check">
    <root name="unbatchInspection_check">
      <SafeHeader
        v-bind="{
          title: '质检判定',
          isBack: true,
          fixedTop: true,
        }"
      ></SafeHeader>
      <v-row class="ma-0 mb-4">
        <v-col
          cols="12"
          class="card-title"
          style="padding-bottom: 8px; padding-top: 8px"
          >待检任务列表</v-col
        >
      </v-row>
      <v-row class="ma-0 mb-4">
        <v-divider></v-divider>
      </v-row>
      <!-- <div class="lineThree"></div> -->
      <v-container width:80%>
        <v-card
          class="mx-auto my-4 list_card"
          max-width="374"
          outlined
          style="board: thin solid #cacbcc"
          v-for="(item, index) in qcTaskList"
          :key="index"
        >
          
          <v-card-text>
            <v-row class="d-flex flex-row justify-space-between">
              <v-col cols="4" class="py-1 card-lable">收货单号</v-col>
              <v-col class="ms-2 py-1 card-value">
                {{ item.acceptRecordCode }}
              </v-col>
            </v-row>
             <v-row>
              <v-col cols="4" class="py-1" style="color: #999999"
                >入库单号</v-col
              >
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
                >{{ item.asnBillNo }}</v-col
              >
            </v-row>
            <v-row>
              <v-col cols="4" class="py-1" style="color: #999999"
                >收货时间</v-col
              >
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
                >{{ item.acceptTime }}</v-col
              >
            </v-row>
            <v-row>
              <v-col cols="4" class="py-1" style="color: #999999">物料编码</v-col>
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
                >{{ item.itemCode }}</v-col
              >
            </v-row>
            <v-row>
              <v-col cols="4" class="py-1" style="color: #999999">物料名称</v-col>
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
                >{{ item.itemName }}</v-col
              >
            </v-row>
           
            <v-row>
              <v-col cols="4" class="py-1" style="color: #999999">批次</v-col>
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
                >{{ item.batchName }}</v-col
              >
            </v-row>
            <!-- <v-row>
              <v-col cols="4" class="py-1" style="color: #999999">执行版本</v-col>
              <v-col class="ms-2 py-1" style="font-size: 0.75rem; color: #666666">{{ item.version }}</v-col>
            </v-row>
            <v-row>
              <v-col cols="4" class="py-1" style="color: #999999">现行版本</v-col>
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
              >{{ item.latestVersion }}</v-col>
            </v-row> -->
            <v-row>
              <v-col cols="4" class="py-1" style="color: #999999"
                >待检数量</v-col
              >
              <v-col
                class="ms-2 py-1"
                style="font-size: 0.75rem; color: #666666"
                >{{ item.quantity }}</v-col
              >
            </v-row>
            <!-- <v-row>
              <v-col cols="4" class="py-1" style="color: #999999">待检数量</v-col>
              <v-col class="ms-2 py-1" style="font-size: 0.75rem; color: #666666">{{ item.djQty }}</v-col>
            </v-row> -->
          </v-card-text>
          <v-divider style="margin-bottom: 5px"></v-divider>
          <div style="text-align: center; margin: 10px 10px 10px 10px">
            <!-- v-show="checkbox == '1' ? (IsCheckbox = false) : true" -->
            <v-row>
              <!-- <v-col cols="6"> -->
              <!-- <v-btn
                  style="
                    padding: 0 20px;
                    background-color: #627aec;
                    color: #fff;
                  "
                  @click="checkBtn(index)"
                  >合格</v-btn
              >-->
              <!-- <v-checkbox
                  v-model="item.checkbox1"
                  color="success"
                  @change="change(index, 1)"
                  :label="`合格`"
              ></v-checkbox>-->
              <!-- </v-col> -->
              <!-- <v-col cols="4"> -->
              <!-- <v-checkbox
                  v-model="item.checkbox2"
                  color="warning"
                  @change="change(index, 2)"
                  :label="`让步`"
                ></v-checkbox>-->
              <!-- <v-btn
                  class="wms-submit-btn"
                  block
                  style="
                  background-color: #ffffff;
                  height: 30px;
                "
                  @click="partialPicking"
                >部分质检</v-btn>
              </v-col> -->
              <!-- <v-col cols="6">
                <v-checkbox
                  v-model="item.checkbox3"
                  color="error"
                  @change="change(index, 3)"
                  :label="`不合格`"
                ></v-checkbox>
              </v-col>-->
            </v-row>
          </div>
          <!-- <v-divider style="margin-bottom: 5px;"></v-divider> -->

          <v-card-text class="">
            <v-row>
              <v-col cols="6" class="py-1 mt-2" style="color: #999999">
                <v-text-field
                  id="hgQty"
                  label="合格数量"
                  dense
                  required
                  hide-details
                  @input="qtyJY(item.qualifiedQuantity, item.quantity, item)"
                  type="number"
                  v-model="item.qualifiedQuantity"
                ></v-text-field>
              </v-col>
              <!-- <v-col cols="4" class="py-1" style="color: #999999">
                <v-text-field
                  label="让步数量"
                  dense
                  required
                  hide-details
                  @input="qtyJY(item.concessionQuantity,item.quantity)"
                  v-model="item.concessionQuantity"
                ></v-text-field>
              </v-col>-->
              <v-col cols="6" class="py-1 mt-2" style="color: #999999">
                <v-text-field
                  label="不合格数量"
                  dense
                  required
                  hide-details
                  @input="qtyJYNew(item.fiedQuantity, item.djQty, item)"
                  v-model="item.fiedQuantity"
                ></v-text-field>
              </v-col>
              <!-- <v-col class="py-1" cols="5">
                <v-checkbox
                  v-model="item.checkbox"
                  label="全部合格"
                  style="zoom: 78%"
                  @change="change(index, IsCheckbox)"
                ></v-checkbox>
              </v-col>-->
            </v-row>
            <!-- <v-row>
              <v-col>
                <v-text-field
                  label="异常单号"
                  clearable
                  class="my-0 inputPlaceholder"
                  dense
                  :disabled="item.checkbox1"
                  hide-details
                  v-model="item.abnormalBillNo"
                ></v-text-field>
              </v-col>
            </v-row>
            <v-row>
              <v-col>
                <v-text-field
                  label="特采单号"
                  clearable
                  class="my-0 inputPlaceholder"
                  :disabled="item.checkbox1"
                  dense
                  hide-details
                  v-model="item.especiallyBillNo"
                ></v-text-field>
              </v-col>
            </v-row>-->
              <v-col cols="12" class="py-1 mt-5" style="color: #999999">
                <v-text-field
                  label="备注"
                  dense
                  required
                  hide-details
                  v-model="item.memo"
                ></v-text-field>
              </v-col>
          </v-card-text>
          <v-divider class="my-0 card-sp-line"></v-divider>
        </v-card>
        <v-row style="position: fixed; bottom: 0; width: 100%">
          <v-col cols="12" style>
            <v-btn
              class="wms-submit-btn"
              style="background-color: #193690; width: 100%; color: #fff"
              @click="submitBtn(qualityForm)"
              >提交</v-btn
            >
          </v-col>
        </v-row>
        <!-- 弹窗 -->
        <!-- <v-dialog v-model="showBoxInfoDialog" max-width="600">
          <v-card class="box_top_content_dialogCard">
            <v-card-title class="box_top_content_dialogCard_title"
              >质检</v-card-title
            >
            <v-card-text style="padding: 8px">
              <v-container>
                <v-row>
                  <v-col cols="12" class="pa-0 pb-2">
                    <v-card outlined style="background-color: #f2f3f5">
                      <v-card-subtitle class="list_content">
                        <v-row
                          class="
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="4" class="py-1 card-lable"
                            >物料编码</v-col
                          >
                          <v-col class="py-1 card-value">
                            {{ GobackBillNo }}
                          </v-col>
                        </v-row>
                        <v-row
                          class="
                            pa-0
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="4" class="py-1 card-lable"
                            >物料名称</v-col
                          >
                          <v-col class="py-1 card-value">
                            {{ qualityForm.itemName }}
                          </v-col>
                        </v-row>
                        <v-row
                          class="
                            pa-0
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="4" class="py-1 card-lable">批次</v-col>
                          <v-col class="py-1 card-value">
                            {{ qualityForm.batchName }}
                          </v-col>
                        </v-row>
                        <v-row
                          class="
                            pa-0
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="4" class="py-1 card-lable">数量</v-col>
                          <v-col class="py-1 card-value">
                            {{ qualityForm.quantity }}
                          </v-col>
                        </v-row>

                        <v-row
                          class="
                            pa-0
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="15" sm="6">
                            <v-radio-group v-model="qualityForm.qcResult" row>
                              <v-radio label="合格" value="1"></v-radio>
                              <v-radio label="不合格" value="0"></v-radio>
                              <v-radio label="让步" value="2"></v-radio>
                            </v-radio-group>
                          </v-col>
                        </v-row>

                        <v-row
                          class="
                            pa-0
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="4" sm="6">
                            <v-text-field
                              label="合格数量"
                              persistent-hint
                              v-model="qualityForm.qualifiedQuantity"
                            ></v-text-field>
                          </v-col>
                          <v-col cols="4" sm="6">
                            <v-text-field
                              label="不合格数量"
                              persistent-hint
                              v-model="qualityForm.fiedQuantity"
                            ></v-text-field>
                          </v-col>
                          <v-col cols="4" sm="6">
                            <v-text-field
                              label="让步数量"
                              persistent-hint
                              v-model="qualityForm.concessionQuantity"
                            ></v-text-field>
                          </v-col>
                        </v-row>
                        <v-row
                          class="
                            pa-0
                            d-flex
                            flex-row
                            justify-space-between
                            wms-v-row
                          "
                        >
                          <v-col cols="4" sm="6">
                            <v-text-field
                              label="异常单号"
                              persistent-hint
                              v-model="qualityForm.abnormalBillNo"
                            ></v-text-field>
                          </v-col>
                          <v-col cols="4" sm="6">
                            <v-text-field
                              label="特采单号"
                              persistent-hint
                              v-model="qualityForm.especiallyBillNo"
                            ></v-text-field>
                          </v-col>
                        </v-row>
                      </v-card-subtitle>
                      <div style="text-align: center; margin: 10px 0">
                        <v-btn
                          style="
                            padding: 0 60px;
                            background-color: #627aec;
                            border-radius: 40px;
                            margin-left: 20px;
                            color: #fff;
                          "
                          @click="saveBtn(qualityForm)"
                          >保存</v-btn
                        >
                      </div>
                    </v-card>
                  </v-col>
                </v-row>
              </v-container>
            </v-card-text>
          </v-card>
        </v-dialog>-->
      </v-container>
    </root>
    <v-overlay :value="overlay">
      <v-progress-circular indeterminate size="64"></v-progress-circular>
    </v-overlay>
    <!-- <v-dialog v-model="isQBHG" min-width="344">
      <v-card class="mx-auto" max-width="344">
        <v-card-title class="text-h5">提 示</v-card-title>
        <v-card-text>
          <p></p>
          <div class="text--primary">确定已经全部合格</div>
        </v-card-text>
        <v-card-actions>
          <v-spacer></v-spacer>
          <v-btn class="ma-2" text color="indigo" @click="isColse()"
            >取消</v-btn
          >
          <v-btn class="ma-2" text color="teal" @click="isConfirm()"
            >确认</v-btn
          >
        </v-card-actions>
      </v-card>
    </v-dialog>-->
  </div>
</template>

<script>
import Root from "@/components/Root.vue";
import { mdiCreditCardScan } from "@mdi/js";
import SafeHeader from "@/components/safeHeader_wms.vue";
import wms from "@/utils/business_wms";
// import _ from "lodash";
import { apiList } from "@/static/apiList";
// import Storage from "@/utils/storage.js";

export default {
  name: "unbatchInspection_check",
  components: {
    Root,
    SafeHeader,
  },
  data() {
    return {
      IsCheckbox: false, //判断点击全部合格复选框 隐藏质检按钮
      radioGroup: null,
      column: null,
      qcResult: "",
      currentIndex: "",
      // 容器详情弹框
      showBoxInfoDialog: false,
      checkbox: "",
      qcTaskList: [],
      //默认屏幕高度
      docmHeight: document.documentElement.clientHeight,
      //实时屏幕高度
      showHeight: document.documentElement.clientHeight,
      //隐藏或显示下方按钮
      hidshow: true,

      mdiCreditCardScan: mdiCreditCardScan,

      overlay: false,
      taskInput: true,
      tab: null,
      dialog: false,
      //   任务标签表单
      taskFrom: {
        billNo: "",
        itemCode: "", //通过物料编码查询
        supplierName: "",
        expectTime: "",
        asnState: "",
        //   任务页面列表
        taskList: [],
      },
      GobackBillNo: this.$root.api.api.pageParam.billCode,
      //   过渡对象
      oldReceipFrom: {
        // 收货单数据
        receiptList: [],
      },
      //   表单数据
      receiptDialogFrom: {
        quantity: "",
        generate: "",
        cell: "",
      },
      // 质检弹窗数据
      qualityForm: {
        quantity: "", //数量
        batchName: "", //批次
        qcResult: "1", // 质检结果 0不合格 1合格 2让步
        qualifiedQuantity: "", //合格数量
        fiedQuantity: "", //不合格数量
        concessionQuantity: "", //让步
        abnormalBillNo: "", //异常单号
        especiallyBillNo: "", //特采单号
        memo:""//备注
      },
      plqualityForm: {
        qcResult: "1", // 质检结果 0不合格 1合格 2让步
        qualifiedQuantity: "", //合格数量
        fiedQuantity: "", //不合格数量
        concessionQuantity: "", //让步
        abnormalBillNo: "", //异常单号
        especiallyBillNo: "", //特采单号
      },
      subForm: {
        acceptRecordCode: "",
        acceptTime: "",
        itemCode: "",
        batchName: "",
        quantity: "",
      },
      subForm1: {
        concessionQuantity: "",
        fiedQuantity: "",
        qualifiedQuantity: "",
      },
      sheet: false,
      //   仓库列表
      cellList: [],

      // cellNum
      generateNum: "",

      // 收货列表
      receiptListData: [],
      // 全部收货确认框标识
      isQBHG: false,
      // 全部收货方法执行标识
      isChangge: false,
      // 全部收货用于过度的索引值
      indexHC: null,
    };
  },
  // created() {},
  methods: {
    // 部分质检
    partialPicking() {
      console.log("1111111");
      document.getElementById("hgQty").disabled = false;
      document.getElementById("hgQty").focus();
    },
    // 数量检验规则
    qtyJY(qty, Allqty, item) {
      if (qty < 0) {
        alert("不能输入负数");
        window.location.reload();
      } else if (qty * 1 + item.fiedQuantity * 1 > Allqty * 1) {
        alert("输入数量不能超过收货数量");
        window.location.reload();
      } else {
        // 质检数量赋值
        let dataList = this.qcTaskList;
        for (let i = 0; i < dataList.length; ++i) {
          if (dataList[i].acceptRecordCode == item.acceptRecordCode) {
            console.log("收货单号---", dataList[i].acceptRecordCode);
            dataList[i].qualifiedQuantity = qty;
            // 刷新数据
            this.qcTaskList.splice(i, 1, dataList[i]);
            console.log("---", this.qcTaskList);
          }
        }
      }
    },
    // 不合格数量检验规则
    qtyJYNew(qty, Allqty, item) {
      if (qty < 0) {
        alert("不能输入负数");
        window.location.reload();
      } else if (qty * 1 + item.qualifiedQuantity * 1 > Allqty * 1) {
        console.log("号---", qty);
        alert("总数不能超过待检数");
        window.location.reload();
      } else {
        let dataList = this.qcTaskList;
        console.log(JSON.stringify(dataList));
        for (let i = 0; i < dataList.length; ++i) {
          if (dataList[i].acceptRecordCode == item.acceptRecordCode) {
            dataList[i].fiedQuantity = qty;
            // 刷新数据
            this.qcTaskList.splice(i, 1, dataList[i]);
             console.log("收货单号---", this.qcTaskList);
          }
        }
      }
    },
    submitBtn(qualityForm) {
      // console.log(qualityForm);
      this.overlay = true;
      let paramsArr = [];
      this.qcTaskList.forEach((item) => {
        console.log(item);
        //判断数量
        let fiedQuantity = item.fiedQuantity ? item.fiedQuantity : 0;
        let qualifiedQuantity = item.qualifiedQuantity
          ? item.qualifiedQuantity
          : 0;
        let allQty =
          Number(qualifiedQuantity) +
          Number(fiedQuantity);
        if (allQty > item.djQty) {
          alert(item.acceptRecordCode + "单质检数量超出收货数量，请确认!");
          return;
        }
        if (
          item.fiedQuantity ||
          item.qualifiedQuantity
        ) {
          paramsArr.push({
            acceptRecordCode: item.acceptRecordCode,
            fiedQuantity: fiedQuantity,
            qualifiedQuantity: qualifiedQuantity,
            memo: item.memo, 
          });
        }
        // this.subForm.acceptRecordCode = item.acceptRecordCode;
        // this.subForm.acceptTime = item.acceptTime;
        // this.subForm.itemCode = item.itemCode;
        // this.subForm.batchName = item.batchName;
        // this.subForm.quantity = item.quantity;
        // this.subForm1.concessionQuantity = item.concessionQuantity
        //   ? item.concessionQuantity
        //   : 0;
        // this.subForm1.fiedQuantity = item.fiedQuantity ? item.fiedQuantity : 0;
        // this.subForm1.qualifiedQuantity = item.qualifiedQuantity;
      });
      // this.qcTaskList.forEach(item => {
      //   this.subForm1.qualifiedQuantity = item.quantity;
      // });
      wms
        .post({ url: "/qc/records/submit", data: { qcRecordList: paramsArr } })
        .then((res) => {
          console.log(res);
          this.overlay = false;
          if (res.status == 200 && res.data.code == 200) {
            //页面跳转
            alert("提交成功");
            if (window.navigator.userAgent.toLowerCase().includes("apicloud")) {
              window.api.openWin({
                name: "unbatchInspection",
                url: "./unbatchInspection.html",
              });
            } else {
              this.$root.api.api.openWin({
                name: "unbatchInspection",
                url: "./unbatchInspection.html",
              });
            }
          } else {
            alert("提交失败:" + 1);
            console.log(JSON.stringify(res.data));
          }
        });
    },
    // 取消全部合格
    // isColse() {
    //   let index = this.indexHC;
    //   // 关闭弹框
    //   this.isQBHG = false;
    //   // 取消单选框选择
    //   this.qcTaskList[index].checkbox = false;
    // },
    // 确认全部合格
    // isConfirm() {
    //   // 关闭弹框
    //   this.isQBHG = false;
    //   // 执行全部合格方法
    //   this.isChangge = true;
    //   this.change(this.indexHC, this.IsCheckbox);
    // },
    change(index, checkboxIndex) {
      let that = this;
      if (checkboxIndex == 1) {
        //全部合格
        if (!that.qcTaskList[index].checkbox1) {
          //取消勾选清空数据
          that.clearChangeData(index);
          let changeData = Object.assign(that.qcTaskList[index], {
            qualifiedQuantity: "",
            concessionQuantity: "",
            fiedQuantity: "",
          });
          that.qcTaskList.splice(index, 1, changeData);
        } else {
          let obj = Object.assign({}, that.qcTaskList[index]);
          let changeData = Object.assign(obj, {
            qualifiedQuantity: obj.quantity,
            concessionQuantity: 0,
            fiedQuantity: 0,
            abnormalBillNo: "",
            especiallyBillNo: "",
            qcResult: 1,
            checkbox2: false,
            checkbox3: false,
          });
          that.qcTaskList.splice(index, 1, changeData);
        }
      } else if (checkboxIndex == 2) {
        //全部让步
        if (!that.qcTaskList[index].checkbox2) {
          //取消勾选清空数据
          that.clearChangeData(index);
          console.log(JSON.stringify(that.qcTaskList[index]));
        } else {
          let obj = Object.assign({}, that.qcTaskList[index]);

          let changeData = Object.assign(obj, {
            qualifiedQuantity: 0,
            concessionQuantity: obj.quantity,
            fiedQuantity: 0,
            qcResult: 2,
            checkbox1: false,
            checkbox3: false,
          });
          that.qcTaskList.splice(index, 1, changeData);
          console.log(JSON.stringify(that.qcTaskList[index]));
        }
      } else {
        //全部不合格
        if (!that.qcTaskList[index].checkbox3) {
          //取消勾选清空数据
          that.clearChangeData(index);
        } else {
          let obj = Object.assign({}, that.qcTaskList[index]);
          let changeData = Object.assign(obj, {
            qualifiedQuantity: 0,
            concessionQuantity: 0,
            fiedQuantity: obj.quantity,
            qcResult: 0,
            checkbox1: false,
            checkbox2: false,
          });
          that.qcTaskList.splice(index, 1, changeData);
        }
      }
    },
    //取消勾选清空数据
    clearChangeData(index) {
      let changeData = Object.assign(this.qcTaskList[index], {
        qualifiedQuantity: "",
        concessionQuantity: "",
        fiedQuantity: "",
      });
      this.qcTaskList.splice(index, 1, changeData);
    },
    plCheckListNew(acceptRecordCode) {
      let params = {
        acceptRecordCode: acceptRecordCode,
      };
      wms.get({ url: "/qc/task/info", data: params }).then((res) => {
        console.log(JSON.stringify(res.data.data.list));
        if (res.status == 200 && res.data.code == 200) {
          //判断状态是否正确
          let dataObj = res.data.data;
          dataObj.quantity = dataObj.qty;
           console.log("哈哈哈哈", JSON.stringify(dataObj));
          this.qcTaskList.push(dataObj);
          this.qcTaskList.forEach((item) => {
            // 合格数量等于收货数量-合格数量-不合格数量
            // item.qualifiedQuantity =
            //   item.quantity -
            //   (item.qualifiedQuantity + item.unqualifiedQuantity);
            // // 不合格数量是0
            // item.fiedQuantity = 0;
            // // 待检数量
            // item.djQty = item.qualifiedQuantity;
            // 待检数量
            item.djQty = item.qty;
            // 收货数量
            item.quantity = item.qty;
          });
          this.taskInput = true;
          // this.taskFrom.supplierName = dataObj.supplierName;
          // this.taskFrom.expectTime = dataObj.expectTime;
          // apiList["asnStates"].forEach(item => {
          //   if (item.value == dataObj.asnState) {
          //     this.taskFrom.asnState = item.label;
          //   }
          // });
        } else {
          alert("查询失败!!");
        }
      });
    },

    plCheckList() {
      let params = {
        asnMasterCode: this.GobackBillNo,
      };
      // 通过接口获取单号数据和列表
      // this.overlay = true;
      wms.get({ url: "/qc/task/list", data: params }).then((res) => {
        // console.log(JSON.stringify(res.data.data.list));
        if (res.status == 200 && res.data.code == 200) {
          this.qcTaskList = res.data.data.list;

          this.qcTaskList.forEach((item) => {
            // 合格数量等于收货数量-合格数量-不合格数量
            item.qualifiedQuantity = null;
            //不合格数量是0
            item.fiedQuantity = null;
            console.log("哈哈哈" + item.qualifiedQuantity);
            // 待检数量
            item.djQty = item.qty;
            // 收货数量
            item.quantity = item.qty;
          });
          //判断状态是否正确
          // let dataObj = res.data.data;

          // this.taskInput = true;
          // this.taskFrom.supplierName = dataObj.supplierName;
          // this.taskFrom.expectTime = dataObj.expectTime;
          // apiList["asnStates"].forEach(item => {
          //   if (item.value == dataObj.asnState) {
          //     this.taskFrom.asnState = item.label;
          //   }
          // });
        } else {
        }
      });
    },
    saveBtn(qualityForm) {
      console.log(qualityForm);
      if (
        qualityForm.qualifiedQuantity == "" ||
        qualityForm.concessionQuantity == "" ||
        qualityForm.fiedQuantity == ""
      ) {
        alert("无数据！");
      } else {
        this.qcTaskList[this.currentIndex].qcResult = qualityForm.qcResult;
        this.qcTaskList[this.currentIndex].qualifiedQuantity =
          qualityForm.qualifiedQuantity;
        this.qcTaskList[this.currentIndex].fiedQuantity =
          qualityForm.fiedQuantity;
        this.qcTaskList[this.currentIndex].concessionQuantity =
          qualityForm.concessionQuantity;
        this.qcTaskList[this.currentIndex].abnormalBillNo =
          qualityForm.abnormalBillNo;
        this.qcTaskList[this.currentIndex].especiallyBillNo =
          qualityForm.especiallyBillNo;
        this.showBoxInfoDialog = false;
        this.qualityForm = [];
      }

      //传入批量质检的列表的接口只需要 合格 不合格 让步 状态 及输入的字段
      // this.plqualityForm.qcResult = qualityForm.qcResult;
      // this.plqualityForm.qualifiedQuantity = qualityForm.qualifiedQuantity;
      // this.plqualityForm.fiedQuantity = qualityForm.fiedQuantity;
      // this.plqualityForm.concessionQuantity = qualityForm.concessionQuantity;
      // this.plqualityForm.abnormalBillNo = qualityForm.abnormalBillNo;
      // this.plqualityForm.especiallyBillNo = qualityForm.especiallyBillNo;
    },

    checkBtn(index) {
      console.log(index);

      // this.currentIndex = index;
      // this.GobackBillNo = this.qcTaskList[this.currentIndex].billNo; //物料编码
      // this.qualityForm.quantity =
      //   this.qcTaskList[this.currentIndex].quantity; //数量
      // this.qualityForm.batchName =
      //   this.qcTaskList[this.currentIndex].batchName; //批次
      // this.qualityForm.itemName =
      //   this.qcTaskList[this.currentIndex].itemName; //物料名称
      // this.showBoxInfoDialog = true;

      //  if (window.navigator.userAgent.toLowerCase().includes("apicloud")) {
      //     // window.api.sendEvent({
      //     //   name: "unbatchInspection_skip",
      //     //   extra: {
      //     //     billNo: item.billNo,
      //     //   },
      //     // });
      //     window.api.openWin({
      //       name: "unbatchInspection_check",
      //       url: "./unbatchInspection_check.html",
      //       // pageParam: {
      //       //   billNo: item.billNo,
      //       // },
      //     });
      //   } else {
      //     // this.$root.api.api.sendEvent({
      //     //   name: "unbatchInspection_skip",
      //     //   extra: {
      //     //     billNo: item.billNo,
      //     //   },
      //     // });
      //     this.$root.api.api.openWin({
      //       name: "unbatchInspection_check",
      //       url: "./unbatchInspection_check.html",
      //       // pageParam: {
      //       //   billNo: item.billNo,
      //       // },
      //     });
      //   }
    },
    checkBtn2(index) {
      console.log(index);
    },

    checkBtn3(index) {
      console.log(index);
    },
  },
  mounted() {
    let this_ = this;
    if (window.navigator.userAgent.toLowerCase().includes("apicloud")) {
      let acceptRecordCode = window.api.pageParam.acceptRecordCode;
      if (acceptRecordCode) {
        this_.plCheckListNew(acceptRecordCode);
      } else {
        this_.plCheckList();
      }
    } else {
      let acceptRecordCode = this.$root.api.api.pageParam.acceptRecordCode;
      if (acceptRecordCode) {
        this.plCheckListNew(acceptRecordCode);
      } else {
        this.plCheckList();
      }
    }
  },
  watch: {
    //判断按钮是否显示
  },
};
</script>


<style lang="scss" scoped>
::v-deep .v-input--radio-group--row .v-input--radio-group__input {
  justify-content: space-around;
}
::v-deep .v-text-field__details {
  min-height: 0 !important;
}
::v-deep .v-application .mb-4 {
  margin-bottom: 0 !important;
}
::v-deep .v-messages {
  min-height: 0 !important;
}
.lineThree {
  border: 0.6px solid #ebebeb;
}

v-deep .v-application .text-right {
  text-align: left !important;
  z-index: 999;
}
::v-deep .v-input--selection-controls {
  margin-top: 0 !important;
  padding-top: 0 !important;
  z-index: 999;
}
.box_top_content_dialogCard {
  .box_top_content_dialogCard_title {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffc352;
    color: #fff;
    padding: 12px 24px 8px !important;
  }
  .card-value {
    text-align: end;
  }
}
</style>
